package com.etcn.common.interceptor;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
public class InterceptorConfigurer extends WebMvcConfigurerAdapter {

	@Bean
    IdentityAuthenticationInterceptor identityAuthenticationInterceptor() {
        return new IdentityAuthenticationInterceptor();
    }
	
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(identityAuthenticationInterceptor()).addPathPatterns("/**").excludePathPatterns(
				"/**/member/register","/**/member/sendregistersms","/**/member/login","/**/member/forgotpwd");
		super.addInterceptors(registry);
	}

}
